package com.asiainfo.iam.mapper;


import com.asiainfo.iam.entity.po.ModoTeam;
import com.asiainfo.iam.entity.po.ModoUser;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ModoUserMapper {


    @Insert("insert into modo_user(id, " +
            "acct_type, " +
            "create_dt, " +
            "default_team, " +
            "email, " +
            "logo, " +
            "user_pwd, " +
            "phone, " +
            "state, " +
            "user_id, " +
            "user_name) " +
            "values(#{id}, #{acctType}, #{createDt}, " +
            "#{defaultTeam}, #{email}, #{logo}, " +
            "#{userPwd}, #{phone}, #{state}, " +
            "#{userId}, #{userName})")
    int insert(ModoUser modoUser);

    @Select("select * from modo_user where user_id = #{user_id}")
    ModoUser findById(String id);



    @Delete("delete from modo_user where user_id = #{userId}")
    void deleteById(String userId);

    @Update("UPDATE modo_user " +
            "SET acct_type = #{acctType}, " +
            "    create_dt = #{createDt}, " +
            "    default_team = #{defaultTeam}, " +
            "    email = #{email}, " +
            "    logo = #{logo}, " +
            "    user_pwd = #{userPwd}, " +
            "    phone = #{phone}, " +
            "    state = #{state}, " +
            "    user_id = #{userId}, " +
            "    user_name = #{userName} " +
            "WHERE id = #{id}")
    void update(ModoUser modoUser);
}
